package com.charzhan.two;

import com.charzhan.utiles.rabbitmqutil;
import com.rabbitmq.client.CancelCallback;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DeliverCallback;

/*

工作一线程
 */
public class work01 {
    public static final String QUEUE_NAME="hello";

    public static void main(String[] args) throws Exception {
        Channel channel = rabbitmqutil.getChannel();
         DeliverCallback deliverCallback=(tag,message)->{
             System.out.println(new String(message.getBody()));
         };
        CancelCallback cancelCallback=tag->{
            System.out.println(tag);

        };
        channel.basicConsume(QUEUE_NAME,true,deliverCallback,cancelCallback);

    }
}
